# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-file-manager
pkgver=5.8.3
pkgrel=3
epoch=1
pkgdesc='Deepin File Manager'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dde-file-manager"
license=('GPL3')
# startdde: for com.deepin.SessionManager
depends=('deepin-qt5integration' 'deepin-anything' 'disomaster' 'docparser' 'file' 'gio-qt'
         'libmediainfo' 'lucene++' 'avfs' 'polkit-qt5' 'poppler' 'ffmpegthumbnailer' 'jemalloc'
         'kcodecs' 'startdde' 'htmlcxx' 'libgsf' 'mimetic' 'boost-libs' 'taglib')
makedepends=('boost' 'qt5-tools' 'deepin-dock' 'deepin-movie' 'deepin-gettext-tools')
optdepends=('deepin-manual: for help menual'
            'deepin-shortcut-viewer: for shortcut display'
            'deepin-screensaver: for screensaver chooser'
            'deepin-movie: for video preview'
            'deepin-terminal: for opening in terminal'
            'deepin-compressor: for compress/decompress')
groups=('deepin')
provides=('deepin-desktop')
conflicts=('deepin-desktop')
replaces=('deepin-desktop')
source=("https://github.com/linuxdeepin/dde-file-manager/archive/$pkgver/$pkgname-$pkgver.tar.gz"
        $pkgname-fix-crash-426.patch::https://github.com/linuxdeepin/dde-file-manager/pull/426.patch)
sha512sums=('0d3cd2335714a66359e1b98a9acaae09f49660dd51c7f479e867c54b2f8add7726afdc2002fa31dcf178c7ede48364e3688cd51f5483fd6e71bd0cf67217a5f1'
            'd27e606930349f906407cd3710894c8ed1080d0a0b9bcfedf01221b830530439b17c369f8c46897ab278b4c083f96ffba64bb024a0e177ccdd716fe5b82d6685')

prepare() {
  cd dde-file-manager-$pkgver
  patch -p1 -i ../$pkgname-fix-crash-426.patch
  sed -e 's|systembusconf.path = /etc/dbus-1/system.d|systembusconf.path = /usr/share/dbus-1/system.d|' \
      -i src/dde-file-manager-daemon/dde-file-manager-daemon.pro
}

build() {
  cd dde-file-manager-$pkgver
  qmake-qt5 PREFIX=/usr filemanager.pro
  make
}

package() {
  cd dde-file-manager-$pkgver
  make INSTALL_ROOT="$pkgdir" install -j1
}
